{% extends 'base.html' %}
{% block content %}
    <form class="form-horizontal" role="form" method="post" action="" >
        <fieldset >
            <legend>修改密码</legend>
            {% if error %}
                <div class="alert alert-danger">
                    {{ error }}
                </div>
            {% endif %}
            {% if msg %}
                <div class="alert alert-success">
                    {{ msg }}
                </div>
            {% endif %}
            <div class="form-group">
                <label for="username" class="col-sm-2 control-label">用户名<span style="color: red"> *</span></label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" id="username" name="username" placeholder="用户名" value="{{ username }}" readonly="readOnly">
                </div>
            </div>
            {% if is_self %}
            <div class="form-group">
                <label for="oldpass" class="col-sm-2 control-label">原来的密码<span style="color: red"> *</span></label>
                <div class="col-sm-4">
                    <input type="password" class="form-control" id="oldpass" name="oldpass" placeholder="原来密码">
                </div>
            </div>
            {% endif %}
            <div class="form-group">
                <label for="password" class="col-sm-2 control-label">新密码<span style="color: red"> *</span></label>
                <div class="col-sm-4">
                    <input type="password" class="form-control" id="password" name="password" placeholder="密码">
                </div>
            </div>
            <div class="form-group">
                <label for="password_again" class="col-sm-2 control-label">确认密码<span style="color: red"> *</span></label>
                <div class="col-sm-4">
                    <input type="password" class="form-control" id="password_again" name="password_again" placeholder="确认密码">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-4">
                    <button class="btn btn-success">确认修改</button>
                </div>
            </div>
        </fieldset>
    </form>
{% endblock %}